﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using SdlDotNet.Core;
using SdlDotNet.Input;
using SdlDotNet.Graphics;
using SdlDotNet.Graphics.Sprites;

namespace TiroParabola
{
    class Objeto:Sprite
    {
        private int botes;
        private int gravedad;
        private int gravedad_inicial = 3;
        private int velocidad_inicial = 50;
        public int Gravedad
        {
            get { return gravedad; }
            set { gravedad = value; }
        }
        private int vx;
        private int ticks = 0;
        public int Vx
        {
            get { return vx; }
            set { vx = value; }
        }

        private int vy;
        public int Vy
        {
            get { return vy; }
            set { vy = value; }
        }
        public void Update() {

            if (ticks % 2== 0)
            {
                X = X + vx;
                Y = Y + vy;
                vy += gravedad;
                ticks = ticks % 2;
            }
            ticks += 1;
            if (Y>555) {
                vy = (int)(-velocidad_inicial*0.3f);
                botes++;
            }
            
        }
        public Objeto() {
            this.Surface = new Surface(@"Dibujos/platillo.png");
            this.X = 0;
            this.Y = 555;
            vx = 0;
            vy = 0;
            Gravedad = 0;
        }
    }
}
